package com.encrypt;

import javax.crypto.Cipher;
import javax.crypto.KeyGenerator;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class Encryptor extends Activity {

	public static final String PREFS_PRIVATE = "PREFS_PRIVATE";
	public static final String KEY_PRIVATE = "KEY_PRIVATE";
	private SharedPreferences prefsPrivate;
	EditText eInputString;
	String inputString;

	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		eInputString = (EditText) findViewById(R.id.enteredString);

		Button bencrypt = (Button) findViewById(R.id.encrypt);
		bencrypt.setOnClickListener(new View.OnClickListener() {

			public void onClick(View v) {

				startActivity(new Intent("com.encrypt.LA"));
				inputString = eInputString.getText().toString();
				prefsPrivate = getSharedPreferences(PREFS_PRIVATE,
						Context.MODE_PRIVATE);
				Editor prefsPrivateEditor = prefsPrivate.edit();
				prefsPrivateEditor.putString(KEY_PRIVATE, inputString);
				prefsPrivateEditor.commit();

			}
		});
	}

}
